//
//  STInnerViewController.m
//  赛拓
//
//  Created by 王磊 on 8/15/16.
//  Copyright © 2016 立金所. All rights reserved.
//

#import "STInnerViewController.h"

@interface STInnerViewController ()<UIWebViewDelegate>

@property (nonatomic ,strong) UIWebView *webView;

@end

@implementation STInnerViewController
- (void)initSubviews {
    [super initSubviews];
    
    UIWebView *webView = [[UIWebView alloc]init];
    
    self.webView = webView;
    
    webView.frame = self.view.bounds;
    
    webView.delegate = self;
    
    [self.view addSubview:webView];
    
    webView.scrollView.showsHorizontalScrollIndicator = false;
    
    webView.scrollView.showsVerticalScrollIndicator = false;
    
    webView.scrollView.bounces = false;
    
    webView.suppressesIncrementalRendering = true;
    
    if (self.webUrl) {
        
        NSURLRequest *requrest = [NSURLRequest requestWithURL:[NSURL URLWithString:self.webUrl]];
        
        [webView loadRequest:requrest];
        
    } else {
        
        
        
    }
    
    
    
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    
    [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"WebKitCacheModelPreferenceKey"];
    
    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDiskImageCacheEnabled"];//自己添加的，原文没有提到。
    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitOfflineWebApplicationCacheEnabled"];//自己添加的，原文没有提到。
    [[NSUserDefaults standardUserDefaults] synchronize];
    
    self.loadingView.loadingStatus = BDLoadingStatusSuccess;
}
@end
